package dkbta.ontology.values;

/**
 * A abstract set of values
 * 
 * @author Uri Kanonov
 */
public interface Values{
	/**
	 * Returns the type of value the implementation represents
	 * 
	 * @return the type of value the implementation represents
	 */
	public ValuesType getValueType();

	/**
	 * Checks whether the given value (in string form) fits into the possible values,
	 * parses it accordingly and returns it. Returns null if the value wasn't valid.
	 * 
	 * @param value The tested value
	 * @return The parsed value according to the values object or null if the value wasn't
	 *         valid.
	 */
	public Object parseAndValidate(String value);

	/**
	 * Checks whether the given value (already parsed) fits into the possible values
	 * 
	 * @param valueType The type of the value
	 * @param value The value
	 * @return Whether the given value fits into the possible values
	 */
	public boolean isValid(ValuesType valueType, Object value);

	/**
	 * Checks whether this Values object contains the given values
	 * 
	 * @param v The values that are checked if contained in these values
	 * @return Whether this Values object contains the given values
	 */
	public boolean contains(Values v);
}
